//
//  UIView+debug.m
//  Pods
//
//  Created by Zhuangyh on 16/1/22.
//
//

#import "UIView+JMdebug.h"


@implementation UIView (JMdebug)

- (void)jm_logView:(NSString*) indentify {
    
    NSLog(@"%@%@", indentify, self);      // dump this view
    
    if (self.subviews.count > 0) {
        NSString* subIndent = [NSString stringWithFormat:@"%@%@",
                               indentify, ([indentify length]/2)%2==0 ? @"| " : @": "];
        for (UIView* aSubview in self.subviews) {
            [aSubview jm_logView:subIndent];
        }
    }
    
}


+ (void)jm_logWindows {
    for (UIWindow* window in [UIApplication sharedApplication].windows) {
        [window jm_logView: @"dumpView: "];
    }
}
@end
